﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyTruongMamNon.Man_Hinh
{
    public partial class frmThuc_Don : Form
    {
        public frmThuc_Don()
        {
            InitializeComponent();
        }
        public void HienThiKhoi()
        {
            string sql = "select * from khoi";
            DataTable dt=new DataTable() ;
            dt=Thu_Vien .ExecuteQuery(sql);
            cboKhoi.DataSource=dt;
            cboKhoi.DisplayMember="Makhoi";
        }

           public void HienThiThucDon()
        {
            string sql = "select * from THUC_DON";
            DataTable dt=new DataTable() ;
            dt=Thu_Vien .ExecuteQuery(sql);
            dtgThucDon.DataSource=dt;
        }


       
        private void frmThuc_Don_Load(object sender, EventArgs e)
        {
            HienThiKhoi();
            HienThiThucDon();
            txtNam.Text = "2010-2011";
        }

        private void cboKhoi_SelectedIndexChanged(object sender, EventArgs e)
        {
            string sql = "select * from THUC_DON where makhoi='" + cboKhoi.Text + "'";
            DataTable dt = new DataTable();
            dt = Thu_Vien.ExecuteQuery(sql);
            dtgThucDon.DataSource = dt;
        }
    }
}
